import type { RouteRecordRaw } from 'vue-router'

const Layout = () => import('@/layout/index.vue')

/** 常驻路由 */
export const constantRoutes: RouteRecordRaw[] = [
  {
    path: '/redirect',
    component: Layout,
    meta: { hidden: true },
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index.vue')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    meta: { hidden: true }
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/error/404.vue'),
    meta: { hidden: true }
  },
  {
    path: '/403',
    component: () => import('@/views/error/403.vue'),
    meta: { hidden: true }
  },
  {
    path: '/',
    redirect: '/dashboard',
    meta: { hidden: false }
  },
  {
    path: '/dashboard',
    name: 'dashboard',
    redirect: '/dashboard/index',
    component: Layout,
    children: [
      {
        component: () => import('@/views/dashboard/index.vue'),
        meta: {
          hidden: false,
          title: '数据统计',
          svgIcon: 'menu-home',
          icon: undefined,
          keepAlive: true,
          bold: false,
          activeMenu: undefined,
          affix: false
        },
        name: 'dataStatistics',
        path: 'index',
        redirect: undefined
      }
    ],
    meta: { hidden: false, bold: true }
  },
  {
    path: '/userChannel',
    name: 'userChannel',
    redirect: '/userChannel/userList',
    component: Layout,
    children: [
      {
        path: 'userList',
        name: 'userList',
        component: () => import('@/views/userChannel/list/index.vue'),
        meta: {
          hidden: false,
          title: '会员列表',
          keepAlive: true,
          affix: false,
          bold: false
        }
      },
      {
        path: 'userDetail',
        name: 'userDetail',
        component: () => import('@/views/userChannel/list/detail.vue'),
        meta: {
          hidden: true,
          title: '会员详情',
          keepAlive: true,
          affix: false,
          bold: false
        }
      }
    ],
    meta: {
      hidden: false,
      title: '会员管理',
      svgIcon: 'menu-user',
      keepAlive: true,
      affix: false,
      bold: true
    }
  },
  {
    path: '/orderManagement',
    name: 'orderManagement',
    component: Layout,
    redirect: '/orderManagement/orderLdist',
    children: [
      {
        path: 'orderLdist',
        name: 'orderLdist',
        component: () => import('@/views/order/list/index.vue'),
        meta: {
          hidden: false,
          title: '订单列表',
          keepAlive: true,
          affix: false,
          bold: false
        }
      }
    ],
    meta: {
      hidden: false,
      title: '订单管理',
      svgIcon: 'menu-document',
      keepAlive: true,
      affix: false,
      bold: true
    }
  },
  {
    path: '/channel',
    name: 'channel',
    component: Layout,
    redirect: '/channel/channelProfit',
    children: [
      {
        path: 'channelProfit',
        name: 'channelProfit',
        component: () => import('@/views/channel/Profit.vue'),
        meta: {
          hidden: false,
          title: `数据明细`,
          keepAlive: true,
          affix: false,
          bold: false
        }
      }
    ],
    meta: {
      hidden: false,
      title: '渠道方管理',
      svgIcon: 'menu-result',
      keepAlive: true,
      affix: false,
      bold: true
    }
  },
  {
    path: '/setting',
    name: 'setting',
    component: Layout,
    redirect: '/setting/channelSetting',
    children: [
      {
        path: 'channelSetting',
        name: 'channelSetting',
        component: () => import('@/views/channel/Detail.vue'),
        meta: {
          hidden: false,
          title: '基础信息',
          keepAlive: true,
          affix: false,
          bold: false
        }
      },
      {
        path: 'channelWithdrawal',
        name: 'channelWithdrawal',
        component: () => import('@/views/channel/Withdrawal.vue'),
        meta: {
          hidden: true,
          title: '提现',
          keepAlive: true,
          affix: false,
          bold: false
        }
      }
    ],
    meta: {
      hidden: false,
      title: '账号管理',
      svgIcon: 'menu-system',
      keepAlive: true,
      affix: false,
      bold: true
    }
  }
]

export default constantRoutes
